﻿
using EquipmentConfig;
using System;
using System.Windows.Forms;

namespace Dexi.SoftwareHeartCheck.UI
{
    public partial class RemoveHistory : Form
    {
        MainForm mf;
       
        public RemoveHistory(MainForm mainForm)
        {
            InitializeComponent();
            mf = mainForm;
        }

        private void Config_Read_Load(object sender, EventArgs e)
        {
            dateTimePicker.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }
        /// <summary>
        /// 确认清除历史数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (dateTimePicker.Text != "" && dateTimePicker.Text != null)
            {
                mf.isRemoveHistory = true;
                mf.removeDate = dateTimePicker.Text;
                this.Close();
            }
            else
            {
                MessageBox.Show("请确认时间！");
            }
            
        }
        /// <summary>
        /// 取消返回
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            mf.isRemoveHistory = false;
            this.Hide();
        }
    }
}
